<div class="main_content">
  <%= form_tag(:controller => "entities", :action => "create_private_popsicle_for_group", :method => "post") do %> 
  <h2>Group Message</h2>
  <% unless @friend_groups.empty? %>
		
    <% if @entity.id == session[:user_id] %>
	<div class="hiddenfield">
	    <%= hidden_field_tag(:private_author_id, @entity.id) %>
	</div>
	<div class="field">
	    <%= label_tag(:recipient_id, "Select Recipient") %></br>
		<%= collection_select(nil,:recipient_id, @friend_groups, :id, :name, {}, {:title=>'Choose recipient'}) %>
	</div>
    <% else %>
	<div class="hiddenfield">
	    <%= hidden_field_tag(:private_author_id, session[:user_id]) %>
		<%= hidden_field_tag(:recipient_id, @entity.id) %>
	</div>
    <% end %>
    <div class="field">
	<%= label_tag(:subject, "Type subject") %></br>
	    <%= text_field_tag(:subject,'', :rows => 1, :placeholder => 'Subject', :title => "Type the subject here" )%>
    </div>
    <div class="field">
	<%= label_tag(:content, "Type message") %></br>
	<%= text_area_tag(:content,'', :rows => 6, :placeholder => 'Enter your message here', :cols => 50, :title => "Type the message here" )%>
    </div>
    <div class="actions">
	<%= submit_tag "Send", :title => "Send the Message" %>
    </div>
  <% else %>
    <p>You must make friends before you can send private messages.</p>
  <% end %>
  <% end %>
</div>
